﻿
@{
    Layout = null;

    var total = 0;
    var totalMessage = "";
    if (IsPost)
    {

        // Retrieve the numbers that the user entered.
        var num1 = Request["text1"];
        var num2 = Request["text2"];

        // Convert the entered strings into integers numbers and add.
        total = num1.AsInt() + num2.AsInt();
        totalMessage = "Total = " + total;
    }
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>VistaFormulario</title>
</head>
<body>
    <p>Enter two whole numbers and then click <strong>Add</strong>.</p>
    <form action="" method="post">
        <p>
            <label for="text1">First Number:</label>
            <input type="text" name="text1" />
        </p>
        <p>
            <label for="text2">Second Number:</label>
            <input type="text" name="text2" />
        </p>
        <p><input type="submit" value="Add" /></p>
    </form>

    <p>@totalMessage</p>
</body>
</html>

@*  A one-line code comment. *@

@*
    This is a multiline code comment.
    It can continue for any number of lines.
*@
	
